<template>
  <div class="paper-container">
    <el-container>
    <el-header style="height:inherit;">
      <el-form :inline="true" :model="formInline" class="demo-form-inline margindis">
        <el-form-item label="试卷名称">
          <el-input v-model="formInline.user"></el-input>
        </el-form-item>
        <el-form-item label="选择分类">
          <el-select v-model="formInline.region" placeholder="活动区域">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="答卷时长">
          <el-input v-model="formInline.user" class="time-input"></el-input>
          &nbsp;分钟
        </el-form-item>
        <el-form-item label="通过分数">
          <el-input v-model="formInline.user" class="time-input"></el-input>
          &nbsp;分
        </el-form-item>
        <div class="write-exam">
          <el-form-item label="笔试说明">
          <el-input type="textarea" v-model="form.desc" class="textarea" resize="none"></el-input>
          </el-form-item>
        </div>
      </el-form>
    </el-header>
      <el-container class="container">
        <el-aside width="40%">
          <div class="btn-bottom">
          <div class="scroll-bar">
               <el-table class="borderdel"
              :data="tableData2" 
              style="width: 100%"
              >
              <el-table-column
              type="index"
              width="40">
              
              </el-table-column>
              <el-table-column
                prop="word"
                label="姓名"
                width="30">
              </el-table-column>
              <el-table-column
                prop="address"
                label="姓名"
                width="280">
              </el-table-column>
              <el-table-column
                align="right"

                >
                <template slot-scope="scope">
                  <el-input v-model="input" placeholder="分值"></el-input>
                  <i class="el-icon-delete"></i>
                </template>
              </el-table-column>
            </el-table>
            </div>
              <div style="margin-top: 20px" class="btn-layout">
                <el-badge :value="12" class="item">
                <el-button class="filter-item" type="primary" v-waves icon="search" @click="search()">手动添加</el-button>
                </el-badge>
                <el-badge :value="12" class="item">
                <el-button class="filter-item" type="primary" v-waves icon="search" @click="search()">批量导入</el-button>
                </el-badge>
                <el-badge :value="12" class="item">
                <el-button class="filter-item" type="primary" v-waves icon="search" @click="search()">从我的题库选择</el-button>
                </el-badge>
              </div>
          </div>
              <el-footer style="height: inherit">
                <div style="margin-top: 20px" class="footer">
                  <p>
                    总题数:<span>x</span>道  
                  </p>
                  <p>
                    总分数:<span>x</span>分  
                  </p>
                <div class="preview">
                <el-badge :value="12" class="item">
                     <div class="review-container">
                    <el-button type="primary" @click="dialogVisible = true">预览</el-button>
                    <el-dialog
                    :visible.sync="dialogVisible"
                    width="40%"
                    :before-close="handleClose"
                    >
                    <div class="test-type">
                            <div class="qr-code">
                                <div>二维码图片</div>
                                <div>手机扫码预览</div>
                            </div>
                            <h4>java初级</h4>
                        </div>
                    <div class="scroll-bar">
                    <div class="review-header">
                        
                        <div class="test-document">
                          <span>答题时长:40分钟</span>
                          <span>共20题 满分100分</span>
                          <span>有效期至:
                            2017/12/31 23:59:59
                          </span>
                        </div>
                        <div class="documet-note clearfix"><div>试卷说明：</div> <div> 试卷包含单选、多选及主观题，答卷机会只有一次，开始答卷后中途退
                                  出视为放弃，交卷前可修改答案，交卷后答案将不可修改。请把握时间，
                                  在截止有效期前交卷。</div>
                        </div>
                    </div>
                      <div class="review-body">
                        <dl>
                          <dt>1、下列说法正确的有（）<span>1101</span></dt>
                          <dd>A． class中的constructor不可省略</dd>
                          <dd>B． constructor必须与class同名，但方法不能与class同名</dd>
                          <dd>C． constructor在一个对象被new时执行</dd>
                          <dd>D．一个class只能定义一个constructor</dd>
                        </dl>
                        <dl>
                          <dt>1、下列说法正确的有（）<span>1102</span></dt>
                          <dd>A． class中的constructor不可省略</dd>
                          <dd>B． constructor必须与class同名，但方法不能与class同名</dd>
                          <dd>C． constructor在一个对象被new时执行</dd>
                          <dd>D．一个class只能定义一个constructor</dd>
                        </dl>
                      </div>
                      </div>
                  </el-dialog>
                </div>
                </el-badge>
                </div>
                <el-badge :value="12" class="item">
                <el-button type="primary" @click="onSubmit" class="btn-padding  btn-margin">提交</el-button>
                </el-badge>
              </div>
              </el-footer>
        </el-aside>
        <el-main>
          <editExam v-if="false"></editExam>
          <batchImport v-if="false"></batchImport>
          <questionSelect></questionSelect>   
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
import editExam from '@/views/quiz/components-exam/edit-exam'  /* 子组件名字不带大括号 */
import batchImport from '@/views/quiz/components-exam/batch-import'
import questionSelect from '@/views/quiz/components-exam/question-select'
import previewForm from '@/views/quiz/previewForm'
export default {
  components: {
    editExam,
    batchImport,
    questionSelect,
    previewForm
  },
   data() {
      return {
        formInline: {
          user: '',
          region: '',
          
        },
        form:{
          desc: ''
        },
         tableData2: [{
          word: "单",
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          word: "单",
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          word: "单",
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          word: "单",
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          word: "单",
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          word: "单",
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          word: "单",
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          word: "单",
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          word: "单",
          address: '上海市普陀区金沙江路 1518 弄'
        }],
      input:'',
       dialogVisible: false,
        value1: '',
        value2: ''
      }
    },
    methods: {
      onSubmit() {
        console.log('submit!');
      },
    }
};
</script>
<style scoped>
.paper-container .container{
  position: absolute;
  left: 180px;
  right: 0;
  top: 220px;
  bottom: 0;
}
  .margindis{
    margin-left: 20px;
    margin-right: 10px;
  }
  .clearfix::after {
      content: ".";
      clear: both;
      display: block;
      overflow: hidden;
      height: 0;
        }

  .clearfix {
      zoom: 1;
  }
  .el-header {
    color: #333;
    padding: 0;
    margin: 0 auto;
    margin-top: 10px;
  }
  
  .el-header>>>.el-input__inner{
    border: 1px solid #797979;
  }
  .el-header>>>.el-textarea__inner{
    border: 1px solid #797979;
  }
  .el-aside {
    color: #333;
    border-left: 1px solid #000;
    border-top: 1px solid #000;
    position: relative;
  }
  .write-exam>div:first-child{
    width: 78%;
  }
  .write-exam>div:first-child>>>.el-form-item__content {
    width: 92%;
  }
  .scroll-bar {
    overflow-y: scroll;
    width: 100%;
    height: 500px;
  }
  .borderdel>>>.el-table_1_column_1 {
    text-align: center;
    color: #fff;
  }
  .borderdel>>>.el-table_1_column_2>.cell{
    padding: 0 4px;
  }
  .borderdel>>>.el-table_1_column_1>.cell>div{
    background-color: #999;
    padding: 0;
    height: 30px;
    width: 30px;
    line-height: 30px;
    border-radius: 50%;
  }
  .borderdel>>>.el-table__body-wrapper {
    overflow: auto;
  }
  .borderdel>>>tr:nth-child(odd){
    background-color: #D7D7D7;
  }
  .el-header .time-input{
      width: 40%;
   }
  .borderdel .el-input{
    width: 16%!important;
    font-size: 12px;
  }
  .borderdel>>>.el-input__inner{
    padding: 0 10px;
  }
  .el-icon-delete{
    font-size: 20px;
  }
  .borderdel>>>.el-table_1_column_6  {
    text-align: right;
  }
  .btn-layout{
    display: flex;
    justify-content: space-around;
  }
  .el-main {
    color: #333;
    text-align: center;
    line-height: 30px;
    border: 1px solid #000;
  }
  .el-footer{
    padding: 0;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    position: absolute;
    bottom: 0;
    width: 100%;
    padding-left: 10px;
  }
  .el-footer>.footer{
    margin-top: 2px!important;
  }
  body > .el-container {
    margin-bottom: 40px;
  }
  .el-table .cell{
    padding-left: 30px!important;
  }
  .el-table .warning-row {
    background: #d7d7d7;
  }

  .el-table .success-row {
    background: #f0f9eb;
  }
  .footer p{
    display: inline-block;
  }
  .btn-margin {
    margin-left: 20px;
  }
  .preview {
    display: inline-block;
  }
  /* 预览框试卷样式 */
  .clearfix::after {
      content: ".";
      clear: both;
      display: block;
      overflow: hidden;
      height: 0;
        }

  .clearfix {
      zoom: 1;
  }
  .scroll-bar {
    max-height: 400px;
    overflow-y: auto; 
  }
  .test-type {
    padding-left: 40px;
    padding-right: 40px;
    margin-bottom: 20px;
  }
  .test-type h4{
    text-align: center;
    margin: 0;
    font-weight: 400;
  }
  .qr-code {
    position: absolute;
  }
  .qr-code>div{
    display: inline-block;
  }
  .qr-code>div:last-child{
    width: 40px;
    font-size: 12px;
    line-height: 16px;
  }
  .review-container>>>.el-dialog__body{
    padding: 0 20px;
  }
  .test-document {
    margin-bottom: 14px;
  }
  .test-document span{
    margin-right: 20px;
  }
  .test-document span:first-child{
     margin-right: 60px;
  }
  .documet-note{
    display: flex;
    flex: 1;
  }
  .test-document,.documet-note {
    padding-left: 60px;
    padding-right: 40px;
  }
  .documet-note>div:first-child{
    min-width: 70px; 
  }
  .review-body {
    padding: 0 120px;
  }
  .review-body dd{
    margin: 0;
  }
  .review-body dt{
    position: relative;
  }
  .review-body dt span {
    position: absolute;
    right: 0;
  }
</style>
<style>
  body{
    margin: 0;
    padding: 0;
  }
  .borderdel.el-table--border td,.borderdel.el-table--border th {
    border-right: 0;
  }
  .borderdel .el-table__header-wrapper{
    height: 0;
  }
</style>

